package org.example.rubbish.dto;

public class WebSocketMessage {
    private String type;        // 消息类型: ALARM, SYSTEM, HEARTBEAT
    private Object data;        // 消息数据
    private Long timestamp;     // 时间戳

    public WebSocketMessage(String type, Object data) {
        this.type = type;
        this.data = data;
        this.timestamp = System.currentTimeMillis();
    }

    public WebSocketMessage() {
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }
}
